Sampled image compression methods and image processing pipeline

ABSTRACT

A method for processing image or video data is performed in an image processing pipeline. Color filtered mosaiced raw image or video data is received. A one-level wavelet transform of subbands of the color filtered mosaiced raw image or video data to provide LL, HH, LH and HL subbands. The LH and HL subbands are de-correlated by summing and difference operations to provide decorrelated sum and difference subbands. Additional n-level wavelet transformation on the sum and difference subbands and the LL and HH subbands to provide sparsified subbands for encoding. LL and HH and sum subbands are recombined into standard color images e.g., red, green, and blue color components, which are subsequently processed by color correction, white balance, and gamma correction. The sparsified subbands are encoded.

PRIORITY CLAIM AND REFERENCE TO RELATED APPLICATION

The application claims priority under 35 U.S.C. § 119 and all applicable statutes and treaties from prior provisional application Ser. No. 62/698,467, which was filed Jul. 16, 2018.

FIELD

A field of the invention is image and video processing. An example application of the invention is to digital cameras, for example, consumer and professional level digital cameras. The invention also provides compression that can make storage of raw video data practical. Additional applications include cloud and internet-of-things applications.

BACKGROUND

Digital imaging systems, including cameras that obtain still and video data, include an image sensor and a color filter. The image sensor itself is capable of sensing intensity of radiation at each pixel of the sensor, which ranges into tens of millions of pixels for modern cameras. Color filters are used to sense color components of each pixel. Known as color filter array or CFA, pixel-sized color filters are patterned to provide three separate color channels, e.g., red (R), green (G), and Blue (B) channels. Each pixel of the image sensor is filtered by the color filter to receive only one of the three or more colors. Accordingly, each pixel does not physically record the full color spectrum incident upon that pixel. The image read out by the sensor is referred to as raw image or raw sensor image or color mosaic image or CFA image. Pixel values of raw images are encoded with pixel intensities, as filtered by their respective color filter array at that pixel. The digital imaging system therefore includes a processing pipeline to process raw image data from the image sensor. A critical initial function of the processing pipeline as used in known imaging systems ranging from inexpensive digital cameras to the highest-level professional model SLR and mirrorless cameras is recovering the fully color value at each pixel of the image sensor as described by intensity of at least three color components, e.g., red, green, and blue. This process is known as de-mosaicing and is conducted as one of the earliest stages of imaging processing.

The de-mosaicing obtains a full-color image, including a set of complete red, green, and blue values (or other color space channels) for each pixel. This de-mosaicing process is required to render raw images into a viewable format.

A widely used patterning of color filters is known as a Bayer color filter array. The de-mosaicing process when the Bayer color filter array is employed is sometimes referred to as debayering. The process is complex but also must be conducted at high speed. Modern imaging systems are capable of processing many images per second. Rendering of these images, such as via viewfinder requires de-mosaicing. Different camera manufacturers and image processing software systems employ different techniques for de-mosaicing. All are designed to permit rendering of a full image in real time or close to real time.

Professional photographers and photo enthusiasts prefer to work directly with the raw sensor data to gain maximum control over the post-processing and set their cameras to store raw sensor data for each frame. Storing the raw sensor data is challenging because of the presence of color filter array, and requires an effective, lossless or low loss (lossy), compression scheme. Many professional grade cameras, for example, are capable of acquiring 5-10 or more frames of data per second, which places significant demands upon compression and storage operations.

Wavelet compression is an image compression technique that can be lossless or lossy. Lossless compression permits an image to be perfectly reconstructed by the compressed data, whereas lossy compression permits an approximation of a perfectly reconstructed image as a function of some compression rate. Zhang and Wu provided a reversible lossless spectralspatial transforms that can remove statistical redundancies in both spectral and spatial domains and applied the Mallat wavelet decomposition scheme, called Mallat wavelet packet transform, to the task of decorrelating color mosaic data. Zhang & Wu, “Lossless Compression of Color Mosaic Images,” IEEE Trans Image Process. 2006 June; 15(6):1379-88. Malvar and Sullivan describe a low-complexity integer-reversible spectral-spatial transform that allows for efficient lossless and lossy compression of raw sensor images. The technique maps the pixel array values into a format that can be directly compressed in a lossless, lossy, or progressive-to-lossless manner. The technique uses an invertible macropixel spectral-spatial transformation (MSST) for each macropixel of a CFA as a pre-processing stage. Malvar and G. J. Sullivan, “Progressive to lossless compression of color filter array images using macropixel spectralspatial transformation,” IEEE Conference of Data Compression, 2012.

It was empirically observed that the one-level wavelet transform of a CFA sampled image was predominantly low passed. N. Zhang and X. Wu, “Lossless compression of color mosaic images,” IEEE Trans. Image Process., vol. 15, pp. 1379-1388, May 2006. There is a profound difference between the LeGall 5/3 wavelet transform of a CFA sampled image shown and the wavelet transform of a luminance image. Specifically, the wavelet sub bands (i.e. LH, HL, and HH) in a CFA wavelet are not sparse, unlike the highly compressible high pass components of an ordinary wavelet. Zhang and X. Wu therefore proposed a Mallat wavelet packet decomposition to sparsify the wavelet transformed raw sensor image data with additional multiresolution analysis.

A rigorous analysis the wavelet transform applied to raw sensor image data has been published. K. Hirakawa and P. J. Wolfe, “Rewiring filterbanks for local fourier analysis: Theory and practice,” IEEE Trans. Inf. Theory, vol. 57, pp. 5360-5374, July 2011. J. T. Korneliussen and K. Hirakawa, “Camera processing with chromatic aberration,” IEEE Trans. Image Process., vol. 23, pp. 4539-4552, August 2014. The analysis is summarized as follows. Let x(n)=[r(n)g(n)b(n)]^(T) be a color image where (r(n)g(n)b(n)) represent the red, green, and blue color components, respectively. Then the CFA sampled data y(n) at pixel location is:

$\begin{matrix} \begin{matrix} {{y(n)} = {{c(n)}^{T}{x(n)}}} \\ {= {{g(n)} + {{c_{r}(n)}{\alpha (n)}} + {{c_{b}(n)}{\beta (n)}}}} \end{matrix} & (1) \end{matrix}$

where α and β defined as α(n)=r(n)−g(n) and β(n)=b(n)−g(n) are taken to be proxies for chrominance images; and the vector c(n)=[c_(r)(n)c_(g)(n)c_(b)(n)]^(T)∈{0,1}³ is a sampling lattice (e.g. c(n)=[1 0 0] denotes a red pixel at pixel location n). The CFA sampled image of (1) is composed of luminance components (fully observed green pixels) and chrominance components (sparsely sampled color differences). The advantage to such decomposition is that α and β are lowpass signals.

The first level input of y(n) is:

w _(i,j) ^(y)(n)=w _(i,j) ^(g) +w _(i,j) ^(c) ^(r) ^(·α)(n)+w _(i,j) ^(c) ^(b) ^(·β)(n)  (2)

where w^(c) denotes the wavelet coefficient for components c (e.g., c=g), and the subband index (i,j)∈{L, H}² denotes lowpass (L) and highpass (H) in the vertical and horizontal directions.

Let L* and H* denote subbands of conjugate wavelet transform coefficients computed using conjugated wavelet filters. Approximating the detail coefficients of chrominance by zero (i.e., w_(i,j) ^(α)(n)=w_(i,j) ^(β)(n) for (i,j)≠{l, L}, the wavelet transform of (2) can be rewritten as:

w _(LL) ^(y)(n)=w _(LL) ^(g)(n)+¼w _(LL) ^(α)(n)+¼w _(LL) ^(β)(n)

w _(LH) ^(y)(n)=w _(LH) ^(g)(n)+¼w _(LL*) ^(α)(n)−¼w _(LL*) ^(β)(n)

w _(HL) ^(y)(n)=w _(HL) ^(g)(n)+¼w _(L*L) ^(α)(n)−¼w _(L*L) ^(β)(n)

w _(HH) ^(y)(n)=w _(HH) ^(g)(n)+¼w _(L*L*) ^(α)(n)+¼w _(L*L*) ^(β)(n)  (3)

The wavelet coefficients of the CFA sampled image are therefore interpreted as a linear combination of the coefficients of luminance and the lowpass coefficients of chrominance. This is appropriate because the LH, HL, and HH subbands are dominated by lowpass components α and β (rather than the highpass components. The Hirakawa and P. J. Wolfe paper defined a relationship between the LH and HL subbands, which relationship has been applied to conduct de-mosaicing.

SUMMARY OF THE INVENTION

A method for processing image or video data is performed in an image processing pipeline. Color filtered mosaiced raw image or video data is received. A one-level wavelet transform of subbands of the color filtered mosaiced raw image or video data is conducted to provide LL, HH, LH and HL subbands. The LH and HL subbands are de-correlated by summing and difference operations to provide decorrelated sum and difference subbands. Additional n-level wavelet transformation on the sum and difference subbands and the LL and HH subbands provide sparsified subbands for encoding. The sparsified subbands are encoded.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a preferred image processing pipeline that conducts lossless compression of a CFA sampled image;

FIG. 2A plots correlated wavelet coefficients; FIG. 2B shows the results of the de-correlation of the LH and HL sub-bands in the FIG. 1 processing pipeline;

FIG. 3 shows a preferred image processing pipeline that conducts lossy compression of a CFA sampled image;

FIG. 4 shows another preferred image processing pipeline that conducts lossy compression of a CFA sampled image; and

FIG. 5 shows a preferred image processing pipeline that conducts image aware compression.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

Preferred methods, pipelines and digital cameras of the invention provide include an efficient lossless or lossy compression that can maximize the quality of color images deconstructed from the decompressed CFA (color filter array) images. Images, as used herein, includes still images and video data, as the invention can be applied to frames of video data that are considered to be images. Preferred embodiments provide a lossless or lossy compression method for raw sensor data and leverage a de-correlated Mallat wavelet transform to generate sparse wavelet coefficients. An experimental system confirmed that methods of the invention improve coding efficiency compared to the standard and the state-of-the-art lossless CFA sampled image and video compression schemes. The wavelet coefficients of CFA sampled images are highly correlated. The present method further makes the correlated wavelet transform sparser. In addition, the invention provides a camera processing pipeline that can maximizing the quality of the color images constructed from the decompressed CFA sampled images and video streams.

The present inventors determined, and rigorous analysis has confirmed, that each one-level wavelet sub band of the CFA sampled image combines low frequency of chrominance and high frequency of luminance components. Lowpass components yield poor compression efficiency because their coefficients are not sparse. The inventors have also determined via analysis that the LH and HL subbands are highly correlated, which is leveraged for the first time in the present invention to enhance compression of raw image data.

Those knowledgeable in the art will appreciate that embodiments of the present invention lend themselves well to practice in the form of computer program products. Accordingly, it will be appreciated that embodiments of the present invention may comprise computer program products comprising computer executable instructions stored on a non-transitory computer readable medium that, when executed, cause a computer to undertake methods according to the present invention, or a computer configured to carry out such methods. The executable instructions may comprise computer program language instructions that have been compiled into a machine-readable format. The non-transitory computer-readable medium may comprise, by way of example, a magnetic, optical, signal-based, and/or circuitry medium useful for storing data. The instructions may be downloaded entirely or in part from a networked computer. Also, it will be appreciated that the term “computer” as used herein is intended to broadly refer to any machine capable of reading and executing recorded instructions. It will also be understood that results of methods of the present invention may be displayed on one or more monitors or displays (e.g., as text, graphics, charts, code, etc.), printed on suitable media, stored in appropriate memory or storage, streamed after encoding, uploaded to the cloud, transmitted via wired or wireless connection, employed in the internet of things, implemented in hardware, integrated circuits, application specific integrated circuits, etc.

Preferred embodiments of the invention will now be discussed with respect to the drawings and experiments used to demonstrate the invention. The drawings may include schematic representations, which will be understood by artisans in view of the general knowledge in the art and the description that follows.

Lossless Compression

FIG. 1 shows a preferred image processing pipeline that conducts lossless compression of a CFA sampled image. The input to the pipeline is a CFA sampled image 10. A black level adjustment 11 can be conducted. A one level wavelet transform 12 is conducted on four subbands, LL, HH, LH and HL. A decorrelator 14 decorrelates the LH and HL subbands. During decorrelation, the LH and HL subbands are subjected to a summing and differencing operation (v_(s) ^(y)(n)=w_(LH) ^(y)+w_(HL) ^(y) and v_(d) ^(y)(n)=w_(LH) ^(y)−w_(HL) ^(y))(further detailed definitions of the sum and difference operations are below). N-level wavelet transforms 16 further transform the LL, HH subbands and the decorrelated LH, HL subbands. Luminance encoders 18 encode the N-level transformed LL subbands and the decorrelated difference channel v_(d) ^(y). Chrominance encoders 20 encode the N-level transformed HH subbands and the decorrelated sum channel v_(s) ^(y).

Each one-level wavelet subband of the CFA sampled image combines low frequency of chrominance and high frequency of luminance components. Lowpass components yield poor compression efficiency because their coefficients are not sparse. The inventors note that, even if decomposed by subsequent wavelet transforms, the coefficients w_(LL*) ^(α), w_(L*L) ^(α), w_(LL*) ^(β) and w_(L*L) ^(β) would never achieve the compression rate of v_(s) ^(y) and v_(d) ^(y) because the latter have a finer scale wavelet transform. The * denotes the subbands of conjugate wavelet transform coefficients computed using conjugated wavelet filters as described in K. Hirakawa and P. J. Wolfe, “Rewiring filterbanks for local fourier analysis: Theory and practice,” IEEE Trans. Inf. Theory, vol. 57, pp. 5360-5374, July 2011.

In a preferred embodiment, the decorrelator 14 decorrelates w_(LH) ^(g) and w_(HL) ^(g) by orthogonal transformation using the bases [1 1]^(T) and [−1 1]^(T). Considering (3), w_(LL*) ^(α) in w_(LH) ^(y) and w_(L*L) ^(α) in w_(HL) ^(y) are the transforms of the same chrominance image α using two different wavelet types. As such, they are highly correlated, as evidenced by w_(LL*) ^(α) plotted against w_(L*L) ^(α), as shown in FIG. 2A. The strength of correlation as indicated by the Pearson moment correlation coefficient is 0.9989. The same relation holds for w_(LL*) ^(β) and w_(L*L) ^(β). In the preferred embodiment, the decorrelator 14 replaces w_(LH) ^(y) and w_(HL) ^(y) by the decorrelated coefficients, which are defined by the following:

v_(d)^(y)(n) = w_(LH)^(y)(n) − w_(HL)^(y)(n) = w_(LH)^(g)(n) − w_(HL)^(g)(n) + 1/4(w_(LL⋆)^(α)(n) − w_(L ⋆ L)^(α)(n)) − 1/4(w_(LL⋆)^(β)(n) − w_(L ⋆ L)^(β)(n)) ${v_{s}^{y}(n)} = {\left\lfloor {\frac{1}{2}\left( {{w_{LH}^{y}(n)} + {w_{HL}^{y}(n)}} \right)} \right\rfloor = \left\lfloor {\frac{1}{2}\left( \left\{ {{w_{LH}^{g}(n)} + {w_{HL}^{g}(n)} + {{1/4}\left( {{w_{{LL} \star}^{\alpha}(n)} + {w_{L \star L}^{\alpha}(n)}} \right)} - {{1/4}\left( {{w_{{LL} \star}^{\beta}(n)} + {w_{L \star L}^{\beta}(n)}} \right)}} \right\} \right)} \right\rfloor}$

The [ . . . ] denotes a floor (rounding down) operation. The coefficients w_(LH) ^(y)(n) and w_(HL) ^(y)(n) can be perfectly reconstructed from v_(d) ^(y)(n) and v_(s) ^(y)(n) from the following relationships:

${{w_{HL}^{y}(n)} = {{v_{s}^{y}(n)} - \left\lfloor \frac{v_{d}^{y}(n)}{2} \right\rfloor}},{{w_{LH}^{y}(n)} = {{v_{d}^{y}(n)} + {w_{HL}^{y}(n)}}}$

The difference subband v_(d) ^(y)(n) decorrelates w_(LL*) ^(α) and w_(L*L) ^(α) as well as w_(LL*) ^(β) and w_(L*L) ^(β). FIG. 2B shows the result of the decorrelation, which is also confirmed by the fact that correlation coefficient reduces to −0.0378. Artisans will appreciate that the each of differences w_(LL*) ^(α)−w_(L*L) ^(α)(n) and w_(LL*) ^(β)−w_(L*L) ^(β)(n) represents a bandpass transform of the respective lowpass signals α and β by a filter LL*−L*L, which is very small.

The decorrelated coefficient v_(d) ^(y)(n) consists of bandpass components w_(LL*) ^(α)−w_(L*L) ^(α) and w_(LL*) ^(β)−w_(L*L) ^(β), which are approximately zero, and a highpass component w_(LH) ^(g)−w_(HL) ^(g). For this reason, the N-level transform 16 can include a minimal number of additional levels of wavelet transforms. Conventional additional N′-level wavelet transforms can be conducted. A preferred wavelet transform is LeGall 5/3 in lossless and 9/7 biorthogonal wavelet in lossy, where N>>N′. In a preferred embodiment, a LeGall 5/3 transform is used to sparsify v_(d) ^(y). Then the transformed v_(d) ^(y) is encoded by the luminance highpass encoding scheme because v_(d) ^(y) is dominated by w_(HL) ^(g) and w_(LH) ^(g). The coding efficiency is nonetheless comparable to the fine level wavelet transform coefficients w_(HL) ^(g) and w_(LH) ^(g). The decorrelation of the invention works with any off-the-shelf encoding methods, and experiments demonstrated the effectiveness in both of a JPEG2000 encoder and in HEVC encoder. After pixels are turned into wavelet transform coefficients (or in in the present invention, decorrelated wavelet transform coefficients), the wavelet coefficient values must be turned into “bits.” This is sometimes called the “encoder” or “variable length encoder” or “entropy coder,” which can be JPEG2000. Advantageously, the decorrelation of the present invention is “encoder-agnostic,” and is independent of the entropy encoder that is used. Entropy encoders are most efficient when coding sparse signal. The decorrelated wavelet transform provided by the invention provides a sparse signal, such that encoder requires fewer bits. Preferred embodiments provide a transform that yields a very sparse output, which is a benefit to any entropy encoder.

The sum subband v_(s) ^(y) represents a combination of low pass components of α and β by the filter LL*−L*L, which is also a lowpass component. The wavelet coefficient v_(s) ^(y) is thus dominated by the chrominance w_(LL) ^(α) and w_(LL) ^(β) and can be treated as a chrominance image. This can be further decomposed by applying an additional LeGall 5/3 transform when using a lossless compression, or 9/7 biorthogonal wavelet transform when using a lossy compression. The N-level wavelet transform of v_(s) ^(y) is encoded (N>>N′) by the lossless encoding scheme of the chrominance component.

The components w_(LL) ^(y) and w_(HH) ^(y) in (3) play the roles of lowpass luminance and chrominance, respectively. Hence, additional wavelet decompositions are applied. N-level Mallat wavelet packet transforms of w_(LL) ^(y) and w_(HH) ^(y) are encoded by luminance and chrominance encoders 18 and 20, respectively.

In wavelet-based compression schemes such as JPEG2000, the coding efficiency increases as more coefficients are concentrated near zero. In order to distribute coefficients around zero, each color component of the CFA sampled image can be shifted by adjusting its offset before taking wavelet transform, as follows:

y′(n)=y(n)−k

where k=[k_(r)k_(g)k_(b)]^(T). The shift k is stored as sideband information to be used to later decompress the image. In experiments, the black offset was computed from a calibration using a color checker. This has the effect of shifting v_(s) ^(y)≅(w_(LL*) ^(α)+w_(L*L) ^(α))/2 and w_(HH) ^(y)(n)≅w_(L*L*) ^(β) toward zero, which further increases coding efficiency.

Lossy Compression

FIG. 3 shows a preferred image processing pipeline that conducts lossy compression of a CFA sampled image. This embodiment adds quantizers 22 between the N-level wavelet transform 16 and the luminance 18 and chrominance 20 encoders. An example transform for the N-level wavelet transform is the Daubechies 9/7 biorthogonal wavelet transform, which has highly correlated w_(LL*) ^(α) and w_(L*L) ^(α) coefficients. FIG. 4 quantizes prior to the N-level wavelet transform.

In the lossy compression, w_(LH) ^(y) and w_(HL) ^(y) are decorrelated by a non-integer transformation. A relationship for this transformation is:

${\begin{bmatrix} {v_{s}^{y}(n)} \\ {v_{d}^{y}(n)} \end{bmatrix} = {M\begin{bmatrix} {w_{LH}^{y}(n)} \\ {w_{HL}^{y}(n)} \end{bmatrix}}},$

where M∈

^(2×2). In FIG. 4, it is v_(s) ^(y) and v_(d) ^(y) that are quantized. The quantized versions can be defined as {circumflex over (v)}_(s) ^(y) (n)=v_(s) ^(y) (n)+q_(s) (n) and {circumflex over (v)}_(sd) ^(y) (n)=v_(d) ^(y) (n)+q_(d) (n), where q_(s) (n) and q_(d) (n) are the quantization errors, which can be approximated as a random variable uniformly distributed over the range of [−0.5, 0.5]. With the choice of M to be M∈

^(2×2), the error between the wavelet coefficients w and its quantized coefficients can be minimized while penalizing non-sparsity of the decorrelated coefficients v, as follows:

${\underset{M}{\arg \mspace{11mu} \min}\mspace{14mu} {\sum\limits_{n}{{\begin{bmatrix} {w_{LH}^{y}(n)} \\ {w_{HL}^{y}(n)} \end{bmatrix} - {M^{- 1}\begin{bmatrix} {{v_{s}^{y}(n)} + {q_{s}(n)}} \\ {{v_{d}^{y}(n)} + {q_{d}(n)}} \end{bmatrix}}}}_{2}^{2}}} + {\lambda {\sum\limits_{n}{{\begin{bmatrix} {v_{s}^{y}(n)} \\ {v_{d}^{y}(n)} \end{bmatrix}}_{l}.}}}$

Here, the first term is the fidelity term penalizing distortions caused by the quantization. The L1 norm in the second term is designed to promote sparse representation. By the law of large numbers (as denoted by the expectation operator

the above can be approximated applying to the quantization errors q_(s) and q_(d)

${{\underset{M}{\arg \mspace{11mu} \min}\mspace{14mu} \left\{ {\sum\limits_{n}\left( {{{M^{- 1}\begin{bmatrix} {q_{s}(n)} \\ {q_{d}(n)} \end{bmatrix}}}_{2}^{2} + {\lambda {\begin{bmatrix} {v_{s}^{y}(n)} \\ {v_{d}^{y}(n)} \end{bmatrix}}_{l}}} \right)} \right\}} = {{\underset{M}{\arg \mspace{11mu} \min}\frac{\mspace{11mu} 1\;}{12}{M^{- 1}}_{F}^{2}} + {\lambda {\sum\limits_{n}{\begin{bmatrix} {v_{s}^{y}(n)} \\ {v_{d}^{y}(n)} \end{bmatrix}}_{l}}}}},$

where the simplification by the Frobenius norm ∥·∥_(F) ² stems from the assumption that q_(s) and q_(d) are zero mean and independent. Increasing the value of λ promotes sparsity (and coding efficiency) at the sacrifice of the reconstruction error. In practice:

${M \simeq {k \cdot \begin{bmatrix} a & a \\ b & {- b} \end{bmatrix}}},$

where the transformation of a and b were stable while k decreased with increasing λ, where v_(s) ^(y)≈ka(w_(LH) ^(α)+w_(HL) ^(α)) and v_(d) ^(y)≈ka(w_(LH) ^(l)+w_(HL) ^(l)). This is reasonable because horizontal w_(LH) ^(l) and vertical w_(HL) ^(l) coefficients behave similarly. The above minimization can also be performed numerically by gradient descent. Data plots verified that the transformation M decorrelates the v_(s) ^(y) and v_(d) ^(y) coefficients, and the Pearson product-moment correlation coefficient decreased to 0.014. The entropy of the decorrelated coefficient reduced from 12.05 to 6.91.

Optimization of Wavelet Transforms

There are two main sources of distortions in lossy com-pression: round-off error and quantization error. The round-off error stems from finite precision operators used to carry out the forward and reverse wavelet transforms. The quantization error (commonly referred to as the “residual error”) is caused by reducing the number of bits to represent wavelet coefficients, at the expense of accuracy. Specifically, a larger quantization step yields higher compression ratio and higher loss in quality.

The interactions between the two sources of noise depend on the bitrate. Although the quantization errors dominate at the low bitrates, the round-off error limits the image quality at the higher bitrates. The inventors have determined that better quality would be achieved if the round-off error is reduced at the higher bitrates. By experimentation, we heuristically arrived at an alternative decomposition scheme that performs better at high bitrates. With regard to FIG. 4 the optimization quantizes the coefficients after the first level Daubechies 9/7 or LeGall 5/3 wavelet transform and takes the decorrelation step. The decorrelated coefficients are quantized before using the LeGall 5/3 to carry out the Mallat-like wavelet packet transform on w_(LL) ^(y), w_(HH) ^(y), and v_(s) ^(y). The LeGall transformation is an integer operation. Since the LeGall 5/3 wavelet transform is reversible, no additional round-off errors are expected. This is in contrast and advantageous compared to the conventional compression scheme of quantizing the coefficients after multiple-level wavelet transform as in H. S. Malvar and G. J. Sullivan, “Progressive-to-lossless compression of color-filter-array images using macropixel spectralspatial transformation,” in Proc. IEEE Conf. Data Compress. (DCC), Snowbird, Utah, USA, April 2012, pp. 3-12.

As the quantization step increases, the round-off error become insignificant relative to the quantization error. Hence at the lower bitrates, we empirically found that Daubechies 9/7 would be more effective for the decorrelated wavelet coefficients.

Camera Processing Pipeline-Aware Lossy Compression

Lossy compression yields an approximation of the desired image with fewer bits. The error introduced by the lossy compression is not uniform to the eye. This is because the uncompressed raw sensor data is further processed by camera processing pipeline (which is comprised of black offset, color correction, white balance, gamma correction, among others) before the image can be observed by the eye. When the error introduced by a uniform quantization propagates through the camera processing pipeline, the end result error is no longer uniform. FIG. 5 provides a camera processing pipeline-aware solution to reduce such distortion. In FIG. 5, a low resolution color construction 32 without the decorrelated v_(d) ^(y) subband is conducted, which permits the generation of sign maps 34 and steps to conduct color correction 36, white balance correction 38 and gamma correction 40. Prior to quantization, a luma/chroma conversion 42 is conducted to decompose the corrected low resolution RGB image (or other canonical color space).

The color construction 32 operation relies upon the fact that the color components x(n) are reconstructable from l, α, and β by the relation:

${x(n)} = {\begin{bmatrix} 1 & 2 & 1 \\ 1 & 0 & {- 1} \\ 1 & {- 2} & 1 \end{bmatrix}\begin{bmatrix} {(n)} \\ {\alpha (n)} \\ {\beta (n)} \end{bmatrix}}$

If w_(LL) ^(y)≈w_(LL) ^(l), w_(HH) ^(y)≈w_(LL) ^(β), and v_(s) ^(y)≈w_(LL) ^(β) (or 2kaw_(LL*) ^(α)) are taken as the “quarter resolution” versions of l, α and β, then the following relation permits reconstruction:

${w_{LL}^{x}(n)} \approx {\begin{bmatrix} 1 & 2 & 1 \\ 1 & 0 & {- 1} \\ 1 & {- 2} & 1 \end{bmatrix}\begin{bmatrix} {w_{LL}^{y}(n)} \\ {v_{s}^{y}(n)} \\ {w_{HH}^{y}(n)} \end{bmatrix}}$

(v_(s) ^(y) is replaced by v_(s) ^(y)/2ka if lossy). In other words, the reconstruction 32 can approximately recover a quarter resolution color image w_(LL) ^(x)(n) directly from the decorrelated one-level wavelet transform coefficients.

Then the corrections used match that used in the camera processing. First, the black offset is subtracted. A demosaicking step estimates the color image from the CFA sampled image. In color correction 36, the tristimulus values of the recovered image corresponding to the spectral transmittance of the color filters are converted to a canonical color space by multiplying by a color transformation matrix. The “white balance” 38 rescales the color to make it (nearly) invariant to the illumination color. Lastly, a compander known as gamma correction 40 enhances the low-intensity pixels while compressing the high-intensity pixels by a non-linear mapping.

FIG. 5 provides a compression designed to minimize the distortion of the color corrected, white balanced, gamma corrected low-resolution color image, and is based upon the premise that the compression would also subsequently maximize the quality of the high-resolution color image reconstructed from the decompressed CFA sampled image. For example, “post-gamma correction” quantization quantizes less aggressively in dark regions where the human eye is more sensitive, while the range compression of the bright regions improves the coding efficiency. Similarly, the combination of color correction and white balance ensures that distortions stemming from lossy compression do not implicitly favor one color over another. FIG. 5 shows a subsequent JPEG2000 compression, where the gamma corrected quarter resolution color image is converted to luma/chroma components, and then N-level wavelet transform is performed and quantization is conducted before encoding the bits. Artisans will appreciate that the invention is independent of the particular image/video compression algorithm employed. The pre-processing of the invention ensures that (a) raw compression is visually optimal for the post-camera processing pipeline image, and (b) reduces the resolution of the image to ¼ so whatever encoding scheme is employed needs to encode far fewer wavelet coefficients. The invention can be considered agnostic to the particular image/video compression scheme that is used.

We note that the approximation used by the low-resolution reconstruction essentially treats v_(s) ^(y) (sum of w_(LL) ^(α) and (w_(LH) ^(l)+w_(HL) ^(l))/2) like a lowpass component w_(LL) ^(α)—justified in part by the fact that w_(LL) ^(α) dominates. There is effectively no image quality penalty associated with this approximation because the highpass components are more aggressively quantized in a typical compression scheme than the lowpass components. In other words, the highpass components included in v_(s) ^(y) are encoded with fewer quantization distortions than a typical compression scheme.

When recovering the quarter resolution color image, a few coefficients can take on negative values (which would not be there if this were the genuine color image). Thresholding them to zero would introduce additional distortion, which is unattractive. Instead, the pipeline takes the absolute value of w_(LL) ^(x), encoding the sign bits separately. The binary image of sign bits is encoded by the standard encoder, which added about 0.004 bits per pixel on average in testing.

While specific embodiments of the present invention have been shown and described, it should be understood that other modifications, substitutions and alternatives are apparent to one of ordinary skill in the art. Such modifications, substitutions and alternatives can be made without departing from the spirit and scope of the invention, which should be determined from the appended claims.

Various features of the invention are set forth in the appended claims. 

1. A method for processing image or video data performed in an image processing pipeline, the method comprising: receiving color filtered mosaiced raw image or video data; conducting a one-level wavelet transform of the color filtered mosaiced raw image or video data to provide LL, HH, LH and HL subbands; de-correlating the LH and HL subbands by summing and difference operations to provide decorrelated sum and difference subbands; conducting additional n-level wavelet transformation on the sum and difference subbands and the LL and HH subbands to provide sparsified subbands for encoding, and encoding the sparsified subbands.
 2. The method of claim 1, wherein the color filtered mosaiced raw image or video data comprises CFA (color filter array) image data.
 3. The method of claim 1, wherein the de-correlating comprises an orthogonal transformation.
 4. The method of claim 1, further comprising quantizing the sum and difference subbands and the LL and HH subbands prior to conducting the additional n-level wavelet transformation.
 5. The method of claim 1, wherein the de-correlating comprises replacing LH (w_(LH) ^(y)) and HL (w_(HL) ^(y)) subband coefficients by decorrelated sum v_(s) ^(y) and difference v_(d) ^(y) coefficients, according to the following the following: v_(d)^(y)(n) = w_(LH)^(y)(n) − w_(HL)^(y)(n) = w_(LH)^(g)(n) − w_(HL)^(g)(n) + 1/4(w_(LL⋆)^(α)(n) − w_(L ⋆ L)^(α)(n)) − 1/4(w_(LL⋆)^(β)(n) − w_(L ⋆ L)^(β)(n)) ${{v_{s}^{y}(n)} = {\left\lfloor {\frac{1}{2}\left( {{w_{LH}^{y}(n)} + {w_{HL}^{y}(n)}} \right)} \right\rfloor = \left\lfloor {\frac{1}{2}\left( \left\{ {{w_{LH}^{g}(n)} + {w_{HL}^{g}(n)} + {{1/4}\left( {{w_{{LL} \star}^{\alpha}(n)} + {w_{L \star L}^{\alpha}(n)}} \right)} - {{1/4}\left( {{w_{{LL} \star}^{\beta}(n)} + {w_{L \star L}^{\beta}(n)}} \right)}} \right\} \right)} \right\rfloor}},$ wherein * denotes the conjugate wavelet transform.
 6. The method of claim 1, further comprising an initial black level adjustment of the color filtered mosaiced raw image or video data.
 7. The method of claim 1, further comprising, prior to n-level wavelet transformation: creating a low resolution canonical color space image from the LL, HH, and sum subbands; correcting the low-resolution image; conducting a luma/chroma decomposition of the low-resolution image.
 8. The method of claim 7, wherein the creating approximates a quarter resolution color image directly from coefficients of the LL, HH, and sum subbands.
 9. The method of claim 1, wherein the correcting comprises color correction, white balance correction and gamma correction.
 10. The method of claim 1, further comprising quantizing the sum and difference subbands and the LL and HH subbands prior to conducting the additional n-level wavelet transformation and wherein the N-level transform comprises a Daubechies 9/7 transform. 